package net.xdclass.order.model.vo;

import java.math.BigDecimal;

public class OrderItemVO {
    // 商品ID
    private Long productId;
    // 购买数量
    private Integer buyNum;
    private String productName;
    private String productImg;
    // 单价
    private BigDecimal amount;
    // 总价 = 单价 * 数量 = amount * count
    private BigDecimal totalAmount;

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public Integer getBuyNum() {
        return buyNum;
    }

    public void setBuyNum(Integer buyNum) {
        this.buyNum = buyNum;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getProductImg() {
        return productImg;
    }

    public void setProductImg(String productImg) {
        this.productImg = productImg;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public BigDecimal getTotalAmount() {
        return this.amount.multiply(new BigDecimal(this.buyNum));
    }

    @Override
    public String toString() {
        return "OrderItemVO{" +
                "productId=" + productId +
                ", count=" + buyNum +
                ", productTitle='" + productName + '\'' +
                ", productImg='" + productImg + '\'' +
                ", amount=" + amount +
                ", totalAmount=" + totalAmount +
                '}';
    }
}
